package com.itheima.admin.controller;

import com.itheima.admin.pojo.AdChannel;
import com.itheima.admin.service.AdChannelService;
import com.itheima.common.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ApiController {
    @Autowired
    private AdChannelService adChannelService;

    /**
     * 查询所有频道
     * @return
     */
    @GetMapping("/api/channel/all")
    public ResultVo<List<AdChannel>> listAll(){
        List<AdChannel> adChannelList = adChannelService.list();
        return ResultVo.ok(adChannelList);
    }
}
